/*
 * Viewport.cpp
 *
 *  Created on: 08/10/2009
 *      Author: ale
 */

#include "Viewport.h"



Viewport::Viewport(const Viewport& otro){
	this->width = otro.width;
	this->height = otro.height;
	this->position = otro.position;
}

Viewport::Viewport(int w, int h,const Punto& otro ) {
	this->position = otro;
	this->width = w;
	this->height = h;
}

Viewport::~Viewport() {

}

void Viewport::mover(FLECHA f){
	switch (f) {
		case UP:{
			position.y(position.y() + 10);
			height += 10;
		}
			break;
		case DOWN:{
			position.y(position.y() - 10);
			height -=10;
		}
			break;
		case RIGHT:{
			position.x(position.x() - 10);
			width -=10;
		}
			break;
		case LEFT:{
			position.x(position.x() + 10);
			width +=10;
		}
			break;
	}
}

void Viewport::zoom(float z){
	if(z != 0.0){
	height += (int) height*z;
	width +=  (int) width*z;
	}


}

int Viewport::getHeight(){
	return height;
}

int Viewport::getWidth(){
	return width;
}

void Viewport::setPosition(const Punto& p){
	this->position = p;
}

Punto Viewport::getPosition(){
	return position;
}

